from typing import Dict
from typing import List
from enum import IntEnum


class Gender(IntEnum):
  male = 1
  female = 2

class UserLoginInfo:
  user_id: str
  handle_time: str
  is_login: bool
  def __init__(self) -> None:
   self.user_id = ""
   self.handle_time = ""
   self.is_login = False


class ProductSaleInfo:
  user_id: str
  product_id: str
  product_category: str
  num: int
  price: float
  buy_time: str
  def __init__(self) -> None:
   self.user_id = ""
   self.product_id = ""
   self.product_category = ""
   self.num = 0
   self.price = 0.0
   self.buy_time = ""


class UserInfo:
  user_id: str
  gender: Gender
  age: int
  register_time: str
  def __init__(self) -> None:
   self.user_id = ""
   self.age = 0
   self.register_time = ""


import x_com_lib 

DXC_NAME = "EcommerceDataSourceService" 
DXC_VERSION = "0.0.1" 
async def subscribe_data():
  await subscribe_data_with_channel_id(0)

async def subscribe_data_with_channel_id(channel_id: int):
  await x_com_lib.xport.send_message(DXC_NAME, DXC_VERSION,channel_id, "SubscribeData", None)

async def play_product_sale_data():
  await play_product_sale_data_with_channel_id(0)

async def play_product_sale_data_with_channel_id(channel_id: int):
  await x_com_lib.xport.send_message(DXC_NAME, DXC_VERSION,channel_id, "PlayProductSaleData", None)

async def play_user_register_data():
  await play_user_register_data_with_channel_id(0)

async def play_user_register_data_with_channel_id(channel_id: int):
  await x_com_lib.xport.send_message(DXC_NAME, DXC_VERSION,channel_id, "PlayUserRegisterData", None)

async def play_user_login_data():
  await play_user_login_data_with_channel_id(0)

async def play_user_login_data_with_channel_id(channel_id: int):
  await x_com_lib.xport.send_message(DXC_NAME, DXC_VERSION,channel_id, "PlayUserLoginData", None)

